Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor amp / bento classes #37156

Closed
wants to merge 26 commits into from

Conversation

kvchari
Copy link
Contributor

@kvchari kvchari commented Dec 8, 2021

blocked by: #37156

@kvchari kvchari changed the title Refactor amp bento classes Refactor amp / bento classes Dec 8, 2021
@kvchari
Copy link
Contributor Author

kvchari commented Dec 8, 2021

regarding the video elements: I'm refactoring the hierarchy like this:

// old hierarchy
bentovideo > pbe > ...
ampvideobase > bentovideo > ...
ampvideo > ampvideobase > ...
bentobrightcove > ampvideobase > ...
ampbrightcove > bentobrightcove > ...
^^ bento-video/brightcove extends amp video stuff which isn't ideal

// new hierarchy
bentovideo > pbe > ...
ampvideobase > pbe > ...
ampvideo > ampvideobase > ...
bentobrightcove > bentovideo > ...
ampbrightcove > ampvideobase > ...

Notes:
bentovideo: is a shared base class for all bento video components. It is also the class for . (its name is staying BaseElement so that the autogenerated web-component.js still works, but can be imported as BentoVideoBaseElement)

ampvideobase: is a shared base class for all amp video components (VideoBaseElement is changing to AmpVideoBaseElement)
bentovideo and ampvideo will share common video component utilities in extensions/amp-video/element.js

@kvchari kvchari force-pushed the refactor-amp-bento-classes branch 4 times, most recently from d2a2b39 to d122f29 Compare December 9, 2021 18:31
@lgtm-com
Copy link

lgtm-com bot commented Dec 9, 2021

This pull request introduces 2 alerts when merging d122f29 into 58a1c29 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Variable not declared before use

@lgtm-com
Copy link

lgtm-com bot commented Dec 9, 2021

This pull request introduces 2 alerts when merging f28fdbc into b6124cb - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Variable not declared before use

@lgtm-com
Copy link

lgtm-com bot commented Dec 9, 2021

This pull request introduces 2 alerts when merging b13499e into faf69c4 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Variable not declared before use

@lgtm-com
Copy link

lgtm-com bot commented Dec 10, 2021

This pull request introduces 2 alerts when merging e78365b into bfd4f7f - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Variable not declared before use

@kvchari kvchari force-pushed the refactor-amp-bento-classes branch 2 times, most recently from 7c0bcda to 6fd70ce Compare December 10, 2021 21:14
@kvchari
Copy link
Contributor Author

kvchari commented Dec 10, 2021

splitting out prelim commits here: #37181

@kvchari kvchari marked this pull request as ready for review December 10, 2021 21:32
@amp-owners-bot
Copy link

Hey @westonruter, @ediamin! These files were changed:

extensions/amp-wordpress-embed/1.0/amp-wordpress-embed.js
extensions/amp-wordpress-embed/1.0/base-element.js
extensions/amp-wordpress-embed/1.0/element.js

@kvchari kvchari requested a review from dmanek December 10, 2021 22:09
@kvchari kvchari force-pushed the refactor-amp-bento-classes branch 2 times, most recently from c67efab to dde4531 Compare December 14, 2021 22:08
@samouri
Copy link
Member

samouri commented Dec 14, 2021

Is there any way to split this into smaller PRs?

@kvchari
Copy link
Contributor Author

kvchari commented Dec 15, 2021

Is there any way to split this into smaller PRs?

I can split this into 1 PR for each commit (I tried to make sure each commit was isolated and related to 1 extension). Would help to get PRs in 1 extension at a time. But would create ~26 PRs, so i opted against it. Would you like me to do that?

@kvchari kvchari marked this pull request as draft December 16, 2021 18:56
@kvchari
Copy link
Contributor Author

kvchari commented Jan 10, 2022

closing in favor of: #37309

closed because the design of AMP components not inheriting from Bento components meant that we have to reimplement a lot of logic in both AMP and Bento classes. This could be a an easy source of bugs in the future if we implement the logic differently or they diverge accidentally. (this was discussed offline)

@kvchari kvchari closed this Jan 10, 2022
@kvchari kvchari deleted the refactor-amp-bento-classes branch January 12, 2022 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants